<template>
	<view class="u-page">
		<view class="header">
		</view>
		<view class="content">

			<view class="projectList">
				<view class="label">投资人列表</view>
				<block v-for="(item, index) in lists" :key="index">
					<view class="lists">
						<view class="filename">
							<image src="../../../static/icon/invem.png" mode=""></image>
						</view>
						<view class="list_contnet">
							<view class="projecttitle">{{item.slUserByUid.username}}</view>
						</view>
						<view class="chakan">
							<text class="tag tag_pendding" v-if="item.status == 0">浅谈中</text>
							<text class="tag tag_finsh" v-else-if="item.status == 1">已投资</text>
							<text class="tag tag_defalut" v-else>已结束</text>
					<!-- 		<uni-tag text="浅谈中" type="primary" size="small" inverted="true" circle="true"
								v-if="item.status == 0"></uni-tag>
							<uni-tag text="已投资" type="success" size="small" inverted="true" circle="true"
								v-else-if="item.status == 1"></uni-tag>
							<uni-tag text="已结束" type="default" size="small" inverted="true" circle="true" v-else>
							</uni-tag> -->
						</view>
					</view>
				</block>
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				pid: '',
				lists: [],
			}
		},
		onLoad(data) {
			console.log(data)
			this.pid = data.id
			this.usersList();

		},
		methods: {
			goback() {
				uni.navigateBack({
					delta: 1
				})
			},
			async usersList() {
				console.log('1111', this.type)
				const users = await this.GQL({
					"operationName": "allSlProjectContracts",
					"query": "query allSlProjectContracts($filter: SlProjectContractFilter) { allSlProjectContracts(filter:$filter) { nodes { status createtime slUserByUid { nickname username uid } } } }",
					"variables": {
						"filter": {
							"pid": {
								"equalTo": this.pid
							}
						}
					}
				})
				if (users.data.allSlProjectContracts.nodes != '') {

					this.lists = users.data.allSlProjectContracts.nodes
				}
			},


		}
	}
</script>

<style lang="scss">
	.u-page {
		background-color: #FBFCFE;
	}

	.header {
		width: 100%;
		height: 200px;
		/* color: #FFFFFF; */
		background: linear-gradient(#C7171E, #f0f2f5);
		/* 标准的语法 */

	}

	.content {
		position: relative;
		top: -200px;

		margin: 15px;

		.label {
			font-size: 16px;
			font-family: PingFangSC-Medium, PingFang SC;
			font-weight: 600;
			color: #161E3E;
			line-height: 16px;
			margin-bottom: 28px;
		}

		.projectList {
			background-color: #FFFFFF;
			border-radius: 5px;
			min-height: 500px;
			padding: 22px 16px;
			.tag{
				padding: 4px 12px;
				background-color: red;
				border-radius: 20px;
			}
			.tag_finsh{
				background-color: #E1EDE3;
				color:#539D5D;
			}
			.tag_pendding{
				background-color: #E4F1FF;
				color:#007AFF;
			}
			.tag_defalut{
				background-color: #E6EAF2;
				color: #9BA7C1;
			}
			.lists {
				// margin-top: 8px;
				display: flex;
				align-items: center;
				border-bottom: 1px solid #e2e2e2;
				// line-height: 30px;
				padding: 10px 0;
				justify-content: space-between;
			}

			.list_contnet {
				width: 180px;
				margin-left: 10px;
				flex: 1;
			}

			.filename {
				font-size: 12px;
				font-family: PingFangSC-Regular, PingFang SC;
				font-weight: 400;
				color: #161E3E;
				line-height: 16px;
				display: flex;
				align-items: center;
			}

			.chakan {
				font-size: 12px;
				font-family: PingFangSC-Regular, PingFang SC;
				font-weight: 400;
				color: #007AFF;
				line-height: 16px;
			}

			image {
				width: 22px;
				height: 22px;
			}

		}
	}
</style>
